<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        /* 
            const修饰数组与对象
         */
        var obj = {name:"张三"};
        console.log(obj.name);
        console.log(obj);

        //改变引用地址
        obj = {name:"李四"};
        console.log(obj.name);
        console.log(obj);

        //申明一个不可变的对象：指的是引用地址不可变
        const obj1 = {name:"张三"};
        console.log(obj1);
        obj1.name = "李四";
        console.log(obj1);
        obj1 = {name:"王五"};//Assignment to constant variable

        //const修饰的对象，可以修改其值，引用地址不会发生变化
    </script>
</head>
<body>
    
</body>
</html>